package com.itheima.job;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;

public class Test02 {
    public static void main(String[] args) {
        HashMap<String,String> hm = new HashMap<>();
        hm.put("邓超","孙俪");
        hm.put("李晨","范冰冰");
        hm.put("刘德华","柳岩");
        hm.put("黄晓明","Baby");
        hm.put("谢霆锋","张柏芝");

        Set<String> keys = hm.keySet();
        for (String key : keys) {
            System.out.println(key + "\t" +hm.get(key));
        }

        Iterator<String> it = keys.iterator();
        while (it.hasNext()){
            String key = it.next();
            System.out.println(key + "\t" +hm.get(key));
        }
    }
}
